package com.ruoyi.demo.service.impl;

import java.util.List;

import com.ruoyi.demo.domain.TbUser;
import com.ruoyi.demo.service.ITbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.TbUserMapper;
import com.ruoyi.common.core.text.Convert;

/**
 * 一对多-用户Service业务层处理
 *
 * @author ruoyi
 * @date 2020-05-23
 */
@Service
public class TbUserServiceImpl implements ITbUserService
{
    @Autowired
    private TbUserMapper tbUserMapper;

    /**
     * 查询一对多-用户
     *
     * @param id 一对多-用户ID
     * @return 一对多-用户
     */
    @Override
    public TbUser selectTbUserById(Long id)
    {
        return tbUserMapper.selectTbUserById(id);
    }

    /**
     * 查询一对多-用户列表
     *
     * @param tbUser 一对多-用户
     * @return 一对多-用户
     */
    @Override
    public List<TbUser> selectTbUserList(TbUser tbUser)
    {
        return tbUserMapper.selectTbUserList(tbUser);
    }

    /**
     * 新增一对多-用户
     *
     * @param tbUser 一对多-用户
     * @return 结果
     */
    @Override
    public int insertTbUser(TbUser tbUser)
    {
        return tbUserMapper.insertTbUser(tbUser);
    }

    /**
     * 修改一对多-用户
     *
     * @param tbUser 一对多-用户
     * @return 结果
     */
    @Override
    public int updateTbUser(TbUser tbUser)
    {
        return tbUserMapper.updateTbUser(tbUser);
    }

    /**
     * 删除一对多-用户对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTbUserByIds(String ids)
    {
        return tbUserMapper.deleteTbUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除一对多-用户信息
     *
     * @param id 一对多-用户ID
     * @return 结果
     */
    @Override
    public int deleteTbUserById(Long id)
    {
        return tbUserMapper.deleteTbUserById(id);
    }
}
